﻿<Window x:Class="TfsBuildManager.Views.RemapWorkspaces"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:TfsBuildManager.Views"
        Title="Remap Workspaces" Height="450" Width="800" ResizeMode="NoResize" WindowStartupLocation="CenterOwner" ToolTip="Remap workspaces in the selected Build definition" Icon="Graphics/AppIcon.ico">
    <Grid HorizontalAlignment="Left" Height="420" VerticalAlignment="Top" Width="792" Margin="0,1,0,0" >
        <Grid.RowDefinitions>
            <RowDefinition Height="100" />
            <RowDefinition Height="*"/>
            <RowDefinition Height="50"/>
        </Grid.RowDefinitions>
        <Grid Grid.Row="0">
            <Grid.RowDefinitions>
                <RowDefinition Height="50"/>
                <RowDefinition Height="50"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="150" />
                <ColumnDefinition Width="200"/>
            </Grid.ColumnDefinitions>
            <Label Grid.Row="0" Grid.Column="0" VerticalAlignment="Center">Workspace Path</Label>
            <TextBox Grid.Row="0" Grid.Column="1" VerticalAlignment="Center" Height="25" Name="TextToSearch" Text="{Binding TextToSearch}"></TextBox>
            <Label Grid.Row="1" Grid.Column="0" VerticalAlignment="Center">New Workspace Path</Label>
            <TextBox Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" Height="24" Name="ReplacementText" Text="{Binding ReplacementText}" Margin="0,9,0,17" TextChanged="ReplacementText_TextChanged"></TextBox>
        </Grid>
        <ListView Name="WorkspacesList" Grid.Row="1" ItemsSource="{Binding WorkspaceItems}" HorizontalAlignment="Stretch">
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="Status" Width="70" DisplayMemberBinding="{Binding Path=Status}">                        
                    </GridViewColumn>
                    <GridViewColumn Header="Source Control Folder" Width="Auto">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <local:HighlightTextBlock Text="{Binding Path=SourceControlFolder}" HighlightPhrase="{Binding ElementName=TextToSearch, Path=Text}" HighlightBrush="Yellow" />
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <GridViewColumn Header="Remapped Source Control Folder" Width="Auto">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <local:HighlightTextBlock Text="{Binding Path=RemappedSourceControlFolder}" HighlightPhrase="{Binding ElementName=ReplacementText, Path=Text}" HighlightBrush="Yellow" />
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                </GridView>
            </ListView.View>
        </ListView>
        <Grid Grid.Row="2">
            <WrapPanel HorizontalAlignment="Right" VerticalAlignment="Center">
                <Button x:Name="ApplyButton" Width="70" Margin="5" Click="ApplyButton_Click">Apply</Button>
                <Button x:Name="CancelButton" Width="70" Margin="5" Click="CancelButton_Click">Cancel</Button>
            </WrapPanel>
        </Grid>
    </Grid>
</Window>
